<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Serrano 1.0</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <link rel="stylesheet" href="css/screen.css" type="text/css" media="screen" />
  <link type="text/css" href="css/custom-theme/jquery-ui-1.8.16.custom.css" rel="Stylesheet" />
  <script type="text/javascript" src="js/jquery-1.6.2.min.js"></script>
  <script type="text/javascript" src="js/jquery-ui-1.8.16.custom.min.js"></script>
  <script type="text/javascript" src="js/jquery.ui.datepicker-es.js"></script>    
</head>
<body>
  <div class="wrap" id="wrap">
    <div class="header" id="header">
      <h2>Serrano 1.0 - Consultas</h2>
      <h3>Sistema transitorio de consultas breves e informes</h3>
      <input name="busqueda" id="busqueda" placeholder="Buscar">
      <input type="submit" value="Buscar">
    </div>
  <div class="header" id="calendario">
    <p>Cargas</p>
    <input type="text" name="fecha" id="campofecha"> 
  </div>
  <div class="sidebar" id="sidebar">
    <ul>
      <li><a href="admin.php" >Modificar y borrar</a></li>
      <li><a href="buscar.php" >buscar</a></li>
    </ul>
  </div>
  <div class="content" id="content">
  </div>
  <div class="nav" id="nav">
    <ul>
      <li><a href="index.php" class="active">Inicio</a></li>
      <li><a href="#"  >Consultas</a></li>
      <li><a href="#" >Informes</a></li>
    </ul>
  </div>
  <div class="resultados"  id="resultados">
<?php
require_once('appvars.php');
require_once('connectvars.php');

if (isset($_GET['DNI'])) {
// Grab the score data from the GET
$grado = $_GET['Grado'];
$lp = $_GET['LP'];
$DNI = $_GET['DNI'];
$apellido = $_GET['Apellido'];
$nombre = $_GET['Nombre'];
}
else if (isset($_POST['grado']) && isset($_POST['dni']) && isset($_POST['apellido'])) {
// Grab the score data from the POST
$grado = $_POST['grado'];
$DNI = $_POST['dni'];
$apellido = $_POST['apellido'];
}
else {
echo '<p class="error">Sorry, no high score was specified for removal.</p>';
}

if (isset($_POST['submit'])) {
if ($_POST['confirm'] == 'Yes') {

// Connect to the database
$dbc = mysqli_connect('localhost', 'serrano' ,'serrano', 'escalafon');

// Delete the score data from the database
print_r($_POST);
$query = "DELETE FROM GENERAL WHERE DNI='$DNI'";
mysqli_query($dbc, $query);
mysqli_close($dbc);

// Confirm success with the user
echo '<p>The high score of ' . $apellido . ' for ' . $DNI . ' was successfully removed.';
}
else {
echo '<p class="error">The high score was not removed.</p>';
}
}
else if (isset($DNI) && isset($lp) && isset($apellido)) {
echo '<p>Seguro que desea borrar este registro?</p>';
echo '<p><strong>DNI: </strong>' . $DNI . '<br /><strong>LP: </strong>' . $lp .
'<br /><strong>Apellido: </strong>' . $apellido . '</p>';
echo '<form method="post" action="borrarPersonal.php">';
echo '<input type="radio" name="confirm" value="Yes" /> Yes ';
echo '<input type="radio" name="confirm" value="No" checked="checked" /> No <br />';
echo '<input type="submit" value="Submit" name="submit" />';
echo '<input type="hidden" name="grado" value="' . $grado . '" />';
echo '<input type="hidden" name="dni" value="' . $DNI . '" />';
echo '<input type="hidden" name="apellido" value="' . $apellido . '" />';
echo '</form>';
}

echo '<p><a href="index.php">&lt;&lt; Volver a la pagina de inicio</a></p>';
?>
  </div>
    <div class="footer" id="footer">
<?php echo "<div class=\"footer\" id=\"reloj\">";
      echo date("h:i:s"); 
      echo "</br></div>";
      //" . date("dS F Y h:i:d A") . "?>
      <p>Copyright &copy; 2011, LoserPals, all rights reserved.</br>
      Puede tener fecha y hora tipo widget. y tal vez nombre de usuario</br></p>
    </div>
   </div>
  </body>
</html>